
public class Teacher {
	    // 属性
	    private String teacherId;   // 教师编号
	    private String name;        // 姓名
	    private String gender;      // 性别
	    private Course course;      // 所授课程

	    // 构造方法
	    public Teacher(String teacherId, String name, String gender) {
	        this.teacherId = teacherId;
	        this.name = name;
	        this.gender = gender;
	    }

	    // 开课方法
	    public void openCourse(Course course) {
	        this.course = course;
	        System.out.println("教师 " + name + " 开设课程：" + course.getCourseName());
	    }

	    // Getter和Setter方法
	    public String getTeacherId() {
	        return teacherId;
	    }

	    public void setTeacherId(String teacherId) {
	        this.teacherId = teacherId;
	    }

	    public String getName() {
	        return name;
	    }

	    public void setName(String name) {
	        this.name = name;
	    }

	    public String getGender() {
	        return gender;
	    }

	    public void setGender(String gender) {
	        this.gender = gender;
	    }

	    public Course getCourse() {
	        return course;
	    }

	    public void setCourse(Course course) {
	        this.course = course;
	    }
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
